package com.example.electronicmall.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.example.electronicmall.R;
import com.example.electronicmall.base.OrderActivity;

public class MyFragment extends AllFragment {

    @Override
    protected void initView() {
        TextView payment = findViewById(R.id.payment);
        TextView deliver = findViewById(R.id.deliver);
        TextView take = findViewById(R.id.take);
        TextView evaluate = findViewById(R.id.user_appraise);
        TextView aftersale = findViewById(R.id.aftersale);
        TextView allOrder = findViewById(R.id.allOrder);
        Intent intent = new Intent(getActivity(), OrderActivity.class);
        Bundle bundle = new Bundle();

        payment.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                bundle.putInt("order", 1);
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
        deliver.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                bundle.putInt("order", 2);
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
        take.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                bundle.putInt("order", 3);
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
        evaluate.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                bundle.putInt("order", 4);
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
        aftersale.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //startActivity(new Intent(getActivity(), MineOrderActivity.class));
            }
        });
        allOrder.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                bundle.putInt("order", 0);
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
        /*user_appraise.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getActivity(), MineEvaluateActivity.class));
            }
        });*/
    }


    @Override
    protected int getLayoutId() {
        return R.layout.fragment_my;
    }
}